window.onload=function(){

    var oBtn1=document.getElementById("btn1");
    var oBtn2=document.getElementById("btn2");
    var oBtn3=document.getElementById("btn3");
    oBtn1.onclick=function(){
        scrollTo(0,0);
    }


    /*oBtn2.onclick=function(){
        scrollTo(0,540);
        /*setInterval(function()
            {
                scrollTo(0,500)
            },200);*/

    /*for(var i=1;i<500;i*10)不能用循环

  /*var elem = document.getElementById("div2");
  var height= 0;
  var id = setInterval(frame, 10);
  function frame() {
    if (height == 300) {
      clearInterval(id);
    }
    else {
      height++;
      elem.style.height = height + '%';
    }
  }
}*/

    oBtn2.onclick=function down() {
        /*var d = setInterval(function () {
            window.scrollTo(start, start + scroDIST);
            start = start + scroDIST;

            var pheight = document.body.scrollHeight;//网页正文全文高
            if (start >= pheight) {
                clearInterval(d);
            }
        }, stime);*/
        scrollTo(0,600);
    }

    oBtn3.onclick=function(){
        scrollTo(0,1140);
    }
}
